﻿using Grow.EventBus.EventData;

namespace Grow.EventBus
{
    /// <summary>
    /// 事件订阅器
    /// </summary>
    public interface IEventPublisher
    {
        IEnumerable<PublisherEventDataDto> GetPublisherEventDatas();

        Task ExecuteAsync<TEventData>(
            Guid eventDataId,
            TEventData eventData,
            DateTimeOffset? delayAt = null,
            IDictionary<string, string>? header = null,
            CancellationToken cancellationToken = default
        ) where TEventData : IEventData;
    }
}